<script>
import Vue from 'vue'
import CheckUpgrade from "@/utils/CheckUpgrade";

export default {
  onLaunch: function () {
    console.log('App Launch')
    var systemInfo = uni.globalData.systemInfo;
    //  Color UI 导航栏配置
    // #ifndef MP
    Vue.prototype.StatusBar = systemInfo.statusBarHeight;
    if (systemInfo.platform === 'android') {
      Vue.prototype.CustomBar = systemInfo.statusBarHeight + 50;
    } else {
      Vue.prototype.CustomBar = systemInfo.statusBarHeight + 45;
	  
    }
    // #endif

    // #ifdef MP-WEIXIN
    Vue.prototype.StatusBar = systemInfo.statusBarHeight;
    let custom = wx.getMenuButtonBoundingClientRect();
    Vue.prototype.Custom = custom;
    Vue.prototype.CustomBar = custom.bottom + custom.top - systemInfo.statusBarHeight;
    // #endif

    // #ifdef MP-ALIPAY
    Vue.prototype.StatusBar = systemInfo.statusBarHeight;
    Vue.prototype.CustomBar = systemInfo.statusBarHeight + systemInfo.titleBarHeight;
    // #endif

    // 小程序更新提示
    // #ifdef MP-WEIXIN
    CheckUpgrade();
    // #endif


    // #ifdef H5
    uni.request({
      url: '/static/json.txt',
      success: res => {
        this.req.setToken(res.data)
      }
    })

    // #endif
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  }
}
</script>

<style>
/*每个页面公共css */
@import "asstes/css/main.css";
@import "asstes/css/icon.css";
@import "asstes/css/common.css";

uni-page-wrapper {
  padding-bottom: var(--window-bottom);
}

</style>
